<?php
require_once 'http://thanhphogame.com/admin/model/DAO/ChatOnlineDAO.php';
class ChatOnlineService {

    public function getAllChatOnline($context, $result, $start, $limit) {
        $appArr = null;
        try {
            $appDAO = new AppDAO($context);

            $appArr = $appDAO -> getAllApp($start, $limit);
            if (isset($appArr) && !empty($appArr)) {
                $result -> setSuccess();
            } else {
                $result -> setFailed("ERR01", "No App Found");
                $context -> logError("ERR01", "No App Found Call By " . __METHOD__ . " ON " . __CLASS__);
            }
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }

        return $appArr;
    }
  
	public function insertChatOnline($context, $result,$param) {
        $chatOnlineArr = null;
        try {
            $chatOnlineDAO = new ChatOnlineDAO($context);

            $chatOnlineArr = $chatOnlineDAO -> insertChatOnline($param);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
        return $chatOnlineArr;
    }

    
	public function deleteApp($context, $result, $id) {
        try {

            $gameLinkDAO = new AppDAO($context);

            $gameLinkDAO -> deleteApp($id);
        } catch (Exception $e) {
            $result -> setException($e);
            $context -> logException($e);
        }
    }
}
?>